<?php

use Phinx\Migration\AbstractMigration;

class AddAiAssistantUserInUserTable extends AbstractMigration
{

    public function up()
    {
        $this->table("user")->insert([
            "name" => "AI小助手",
            "email" => "ai-assistant@teamones.com",
            "password" => create_pass("default-password"),
            "phone" => "11111111113",
            "status" => 1,
            "sex" => "female",
            "uuid" => create_uuid(),
            "active" => 1,
            "is_system" => "yes",
            "channel" => "",
        ])->saveData();
    }

    public function down()
    {
        $this->execute("delete from user where phone='11111111113' and is_system='yes'");
    }
}
